package com.bookRecommend.mapper;


import com.bookRecommend.model.User;
import com.bookRecommend.provider.UserProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author Administrator
 * @description 针对表【user(用户表)】的数据库操作Mapper
 * @createDate 2022-07-20 21:59:21
 * @Entity .User
 */
public interface IUserMapper {

    @Select("select * from user")
    List<User> selectAllUsers();

    @Select("select * from user where `username` = #{username} and `password` = #{password}")
    User selectByUserNameAnaPassword(User user);

    @InsertProvider(UserProvider.class)
    int insertUser(User user);


    @UpdateProvider(UserProvider.class)
    int updateUser(User user);

    @SelectProvider(UserProvider.class)
    List<User> selectByUser(User user);

    @Delete("delete from user where id = #{id}")
    int deleteById(Integer id);
}




